新建maven springboot项目遇到依赖jar包无法导入问题经验总结

您所在的位置:网站首页 idea maven包导不进来 新建maven springboot项目遇到依赖jar包无法导入问题经验总结

新建maven springboot项目遇到依赖jar包无法导入问题经验总结

2024-05-26 08:35| 来源: 网络整理| 查看: 265

本人小白,跟着b站尚硅谷学springboot SpringBoot视频教程(idea版)_2018_Java视频_spring boot_springboot核心篇+… https://www.bilibili.com/video/av38657363/?p=5 视频p05 新建maven项目后,在导入maven的spring jar包依赖时报错

1.一开始无法导入 报错:Unable to import maven project: See logs for details springboot 在这里插入图片描述 有这两个error 在这里插入图片描述

百度了第一个error No implementation for org.apache.maven.model.path.PathTranslator was bound. 应该是我下载的maven版本过高了 “可能是maven版本过高导致的,我用的maven3.5.4,没有出现过什么问题” https://ask.csdn.net/questions/789238 于是我换成了maven3.3.9,成功auto-import

加载速度过慢问题 百度:springboot 一直在downloading plugins for alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central https://blog.csdn.net/shayboke/article/details/71156393 亲测有用,过了几分钟就下完了

2.添加依赖语句后报错 pom.xml文件中添加 在这里插入图片描述

1.5.9 RELEASE报错 spring-boot-starter-parent报错 spring-boot-starter-web报错 (截图都没报错,是事后截的)

3.第一个报错 在这里插入图片描述 1.5.9.RELEASE找不到 百度:project ‘org.springframework.boot:spring-boot-starter-patent:.RELEASE’ not found 解决方法: 就是找到maven文件的conf文件的settings.xml,在里面添加这个语句 mirrorId central Human Readable Name for this Mirror. http://central.maven.org/maven2/ https://blog.csdn.net/yangqjiayou/article/details/76399907 亲测有用,第一个红色报错解决了,但是用上面那个aliyun的应该也是可以下载RELEASE包的

4.第二个报错 在这里插入图片描述 百度:Dependency ‘org.springframework.boot:spring-boot-starter-web:’ not found inspects a maven m 有人说因为tomcat里原来有个这包,所以新的包导入不进去 https://www.imooc.com/qadetail/253935 但是我试了,对我来说无用

又是tomcat冲突的 https://ask.csdn.net/questions/747582 对我无用

首先我们排除spring-boot-starter-web依赖中的Tomcat:在pom文件中排除tomcat的starter org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat https://www.zhangshengrong.com/p/281omKejNw/ 亲测无用

乱逛逛到了maven网站 MVN REPOSITORY https://mvnrepository.com/artifact/org.springframework.boot

这个博主的mirror地址应该是最稳定的 解决方法: 就是找到maven文件的conf文件的settings.xml,在里面添加这个语句 alimaven aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ central https://blog.csdn.net/leo3070/article/details/81019878 我觉得的地址:central要比下面另一个地址groups/public更加全,更稳定 但是我添加进setting.xml的时候两个都写了

idea使用maven下载不了依赖包问题 这个博主的方法我试了,用一点点用,但是解决不了我的报错 https://www.baidu.com/link?url=3nD5tjqtMgdfglLcsyThQO3z4bM5sXTzGFoFLezwrhzB3cz8VuFBJvyAOSahCDvFZ14y1j5h9b5cBl3pBwrWUBFTKAlPg0k4XSqZOnR_wce&wd=&eqid=e085034100015019000000065d81ed8f 应该可以增加下载jar包的速度

spring-snapshots http://repo.spring.io/snapshot true spring-milestones http://repo.spring.io/milestone spring-snapshots http://repo.spring.io/snapshot spring-milestones http://repo.spring.io/milestone

其他杂的网站: 添加镜像mirror alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central https://blog.csdn.net/Certain_/article/details/90745360 是对的,但是还是报错

其他方法 https://www.cnblogs.com/zealousness/archive/2018/07/21/9345650.html 没试过

最后,问题源自于我自己打错了, spring-boot-starter-web 被我输入为spring – boot – starter - web 因为是从pdf文档复制过来的(我懒),所以导入的时候是 - ,多了两个空格,识别不了,无法导入jar包 我一直以为是mirror地址的问题,在找比较全比较稳定的mirror地址 一共改了1个多小时吧,终于发现了这个问题(想钻进洞去死)

贴很多个找到的mirror镜像地址大全: https://blog.csdn.net/steven_zhulin/article/details/90724983 alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central

uk central Human Readable Name for this Mirror. http://uk.maven.org/maven2/ CN OSChina Central http://maven.oschina.net/content/groups/public/ central nexus internal nexus repository http://repo.maven.apache.org/maven2 central

5.过程中学会的一些小技巧: idea 如何enable auto-import File->Settings->Maven->Importing->Import Maven projects automatically 在这里插入图片描述 https://blog.csdn.net/nuistcc/article/details/84921200

springboot 依赖下载不下来的问题 在这里插入图片描述 删了repository的文件重装是一个好方法 https://www.oschina.net/question/1421583_2278747



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3